package me.send.broker.service;

import java.util.List;
import java.util.Map;

import me.send.broker.entity.WithdrawOrder;
import me.send.broker.pojo.WithdrawRecordBean;

public interface WalletService {
	public static final int BATCH_NUM=10;
	
    /**
     * 根据经纪人id获取经纪人钱包中的可取余额，代沟金额和小费金额
     * @param popid
     * @return 可取余额，代购金额，小费金额
     */
    List<Double> getBalance(int popid);
    
    /**
     * 生成提现记录
     * @param wr 生成提现记录的一些基本信息
     */
    void buildRecord(WithdrawRecordBean wr);
    
    /**
     * 经纪人钱包变动增加记录
     * @param param
     */
    void addBrokerWalletLog(Map<String, Object> param);
    
    /**
     * 提现申请提交之后触发的一系列动作
     * @param wr
     */
    void withdrawInvoke(WithdrawRecordBean wr);
    
    /**
     * 获取经纪人端钱包的小费记录
     * @param popid 经纪人id
     * @return
     */
    List<Map<String, Object>> chargeInDetails(Map<String, Object> param);
    
    /**
     * 获取经纪人端钱包的小费总额
     * @param popid 经纪人id
     * @return 总额
     */
    double chargeInTotal(int popid);
    
    int chargeInPage(Map<String, Object> param);
    
    /**
     * 获取经纪人端钱包的代购金额
     * @param popid 经纪人id
     * @return
     */
    List<Map<String, Object>> buyDetails(Map<String, Object> param);
    
    /**
     * 获取经纪人端钱包的代购总额
     * @param popid 经纪人id
     * @return 总额
     */
    double buyTotal(int popid);
    
    int buyPage(Map<String, Object> param);
    
    /**
     * 获取经纪人端钱包的可取余额明细
     * @param popid 经纪人id
     * @return
     */
    List<Map<String, Object>> allDetails(Map<String, Object> param);
    
    /**
     * 获取经纪人端钱包可取余额,该值为计算后的可取余额
     * @param popid 经纪人id
     * @return 总额
     */
    double allTotal(int popid);
    
    int allPage(Map<String, Object> param);
    
    /**
     * 经纪人端钱包数据
     * @param popid 经纪人id
     * @return
     */
    Map<String, Object> myWallet(int popid);
    
    /**
     * 经纪人端提现记录
     * @param popid 经纪人id
     * @return
     */
    List<Map<String, Object>> withdrawDetails(Map<String, Object> param);
    
    /**
     * 经纪人正在提现的总额
     * @param popid
     * @return
     */
    double inWithdraw(int popid);
    
    int withdrawPage(Map<String, Object> param);
    
    
    /**
     * 用户在确认付款成功之后,给经纪人钱包增加代购和小费额
     * @param param
     */
    void payToBroker(Map<String, Object> param);
    
    /**
     * 用户在确认付款成功之后,给经纪人钱包记录增加新的记录
     * @param param
     */
    void payToBrokerRecord(Map<String, Object> param);
    
    
    /**
     * 根据唯一订单号获取支付订单详细信息
     * @param orderNo
     * @return
     */
    Map<String, Object> getPayOrderByNo(String orderNo);
    
    void buildBatchWithdrawOrder(final String pattern);
    
    void buildBatchWithdrawOrderBefore12();
    
    void buildBatchWithdrawOrderAfter12();
    
    int queryWithdrawOrderCount(String time);
    
    void genBatchWithdrawOrder(String batchOrderNo,String pattern);
    
    List<WithdrawOrder> queryAliWithdrawOrdersByBatchOrderNo(String batchOrderNo);
    
    void dealWithAliBatchWithdrawResult(Map<String,WithdrawOrder> successMap,Map<String,WithdrawOrder> failMap,String batch_no);
    
    void dealWithSuccessAliBatchWithdrawResult(Map<String,WithdrawOrder> successMap,String batch_no,String notify_id);
    
    void dealWithFailAliBatchWithdrawResult(Map<String,WithdrawOrder> failMap,String batch_no,String notify_id);
    
}
